<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich">
<ui:composition
        template="/WEB-INF/template/home.xhtml">
    <ui:define name="location">
        #{msg['dep.location']}
    </ui:define>
    <ui:define name="context">
        <h:form id="depGrid" prependId="false">
            <!--tool-->
            <rich:toolbar id="ToolBar">
                <rich:toolbarGroup id="ActionToolBar">
                    <a4j:commandLink id="add" styleClass="no-decor" value="#{msg['link.add']}" execute="@this"
                                     render="editDepEntity" action="#{depBean.popupAdd}" limitRender="true"
                                     oncomplete="PawnPopup.show('depEntity')">
                    </a4j:commandLink>
                </rich:toolbarGroup>
                <rich:toolbarGroup>

                </rich:toolbarGroup>
                <rich:toolbarGroup id="SearchToolBar" location="right">

                    <h:inputText id="SearchDepName" value="#{depBean.filterValues['depName']}">
                        <a4j:ajax render="depList@body scroller" event="keyup"/>
                    </h:inputText>
                </rich:toolbarGroup>

            </rich:toolbar>
            <ui:include src="dep/list.xhtml"/>
        </h:form>


        <!--新增或者编辑面板-->
        <rich:popupPanel id="depEntity" width="500" autosized="true">
            <f:facet name="header">
                <a4j:outputPanel ajaxRendered="true">
                    <h:outputLabel id="popup_title"
                                   value="#{depBean.entity.id == 0 ? msg['link.add'] :msg['link.Edit']}#{msg['dep.info']}"/>
                </a4j:outputPanel>
            </f:facet>
            <f:facet name="controls">
                <h:graphicImage value="#{resource['images/close.png']}" styleClass="hand"
                                onclick="PawnPopup.hide('depEntity')"/>
            </f:facet>
            <ui:include src="dep/entity.xhtml"/>
        </rich:popupPanel>

    </ui:define>
</ui:composition>
</html>